<?php

namespace App\Models;

use App\Models\BaseModel;
use Illuminate\Database\Eloquent\Relations\HasMany;

class Dict extends BaseModel
{
    protected $table = 'dicts';

    protected $fillable = [
        'name',
        'dictCode',
        'status',
        'remark'
    ];

    /**
     * 获取该字典的所有字典项
     */
    public function dictItems(): HasMany
    {
        return $this->hasMany(DictItem::class, 'dict_id');
    }
}
